/**
 * Created by 小丽丽 on 2015/3/23.
 */

define('chat', function () {
    return chat = avalon.define({
        $id: "chat",
        //页面准备好时调用
        ready: function () {
            chat.autoHeight();
        },

        //左侧的人员列表 name用户名，notRead是否已读
        msgList:[
            {name:'通知',flag:false,notRead:true},
            {name:'MOMO',flag:false,notRead:false},
            {name:'菲儿',flag:false,notRead:false},
            {name:'斯蒂夫',flag:false,notRead:true},
            {name:'慕容浮空',flag:false,notRead:false},
          ],

        //左侧的人员列表鼠标悬浮时显示移除按钮
        hovering: function (index) {
            chat.msgList [index].flag=!chat.msgList [index].flag;
          },
        autoHeight: function () {
            var adaptHeight = function () {
                var x = $(window).height();
                document.getElementById("msgWindow").style.height =(x*4/5) + 'px';

              $('.msg-window').css('height', (x*4/5) + 'px');
            };
            adaptHeight();

        }


    })
})